package refect;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * Created by Zhou_Bing on 2019/4/2.
 */
public class Demo {

    public void test(){
        System.out.println("aa");
    }

    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {

        Class clz = Demo.class;
        Method method = clz.getMethod("test");
        method.invoke(new Demo(),null);

    }

}
